package org.abstractmeta.commandify.core.command.accessor;

import org.abstractmeta.reflectify.Accessor;

import java.util.Collection;
import java.util.Map;

/**
* Created with IntelliJ IDEA.
* User: adrianwit
* Date: 6/28/13
* Time: 9:43 PM
* To change this template use File | Settings | File Templates.
*/
public class MapValueAccessor<K, T> implements Accessor<Map<K, T>, T> {

    private final K key;

    public MapValueAccessor(K key) {
        this.key = key;
    }

    @Override
    public T get(Map<K, T> instance) {
        return instance.get(key);
    }


    public K getKey() {
        return key;
    }
}
